//
//  ZXZDealViewController.m
//  sheyingzu
//
//  Created by tyu on 30.5.24.
//

#import "ZXZDealViewController.h"

#import <WebKit/WebKit.h>

@interface ZXZDealViewController ()
@property(nonatomic,weak) WKWebView *webView;


@end

@implementation ZXZDealViewController
//

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupView];
}

- (void)bac_addUI
{
    [super bac_addUI];
    
    [self setupView];

   
    self.bacTitleLabel.text = self.titleStr;
    [self.view bringSubviewToFront:self.navView];

    
}
- (void)setupView
{

    [self kkInitWebView];
}

- (void)kkInitWebView
{
    WKWebView *webview= [[WKWebView alloc] init];
    [self.view addSubview:webview];
    self.webView = webview;
    webview.frame = CGRectMake(0, CGRectGetMaxY(self.navView.frame)-20, ScreenWidth, ScreenHeight-self.navView.frame.size.height);
//    webview.frame = self.view.bounds;

    self.webView.backgroundColor = [UIColor whiteColor];

    
    NSURL *url = nil;
    if ([self.urlStr hasPrefix:@"http"]){
        url = [NSURL URLWithString:self.urlStr];
    }else{
        // 加载本地文档
        url = [NSURL fileURLWithPath:self.urlStr];
    }
    
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:request];

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
